<?php

class Sgit_Util_FileUpload
{

    static function run($table,$key)
    {

         
        $file['tabla']=$table;
        $file['name']='key_'.$key;
        $file['key']=$key;
        $file['activo']=$file['name'].'_activos';
        $file['dir']=PUBLIC_DOCUMENT.DS.$file['tabla'].DS.$file['key'];
        
        if(!file_exists(PUBLIC_DOCUMENT.DS.$file['tabla'])) mkdir(PUBLIC_DOCUMENT.DS.$file['tabla']);
        if(!file_exists($file['dir'])) mkdir($file['dir']);
        
        return $file;
    }
    
}
